Skip to content

Try out goreleaser for creating packages for dnst and dnst-ldnsutils#169

Draft
mozzieongit wants to merge 10 commits intomainfrom
try-goreleaser
Draft

Try out goreleaser for creating packages for dnst and dnst-ldnsutils#169
mozzieongit wants to merge 10 commits intomainfrom
try-goreleaser

Conversation

@mozzieongit
Copy link
Copy Markdown
Member

@mozzieongit mozzieongit commented Apr 28, 2026

In our effort to move to a new release process I tried out goreleaser, which works quite well. We can build packages (incl. meta packages like dnst-ldnsutils), cross-compile for different architectures (limited to this list, but includes the usual targets and covers our needs), sign using gpg (which also allows us to use smart cards for signing).

Here is a successful attempt of using Goreleaser to create packages for dnst (and dnst-ldnsutils).

The pkg/generate-man-pages.sh script uses uv to setup the python environment quickly and builds the man pages for packaging.

Run goreleaser: goreleaser release --clean --snapshot (optionally with --verbose)

For testing a release locally (without the requirement for the current commit to be tagged and a clean worktree) you can use the --snapshot flag for goreleaser.

Files generated by goreleaser (without --snapshot, with --snapshot would insert SNAPSHOT-commit into the version):

$ eza -lT --no-user --no-time --no-git dist
drwxr-xr-x    - dist
.rw-r--r--  42k ├── artifacts.json
.rw-r--r--  11k ├── config.yaml
.rw-r--r-- 5.9M ├── dnst-0.2.0alpha2-1-aarch64.pkg.tar.zst
.rw-r--r-- 5.2M ├── dnst-0.2.0alpha2-1-armv7h.pkg.tar.zst
.rw-r--r-- 4.4M ├── dnst-0.2.0alpha2-1-x86_64.pkg.tar.zst
.rw-r--r-- 6.4M ├── dnst-0.2.0~alpha2-1.aarch64.rpm
.rw-r--r-- 5.8M ├── dnst-0.2.0~alpha2-1.armv6hl.rpm
.rw-r--r-- 5.8M ├── dnst-0.2.0~alpha2-1.armv7hl.rpm
.rw-r--r-- 5.0M ├── dnst-0.2.0~alpha2-1.x86_64.rpm
drwxr-xr-x    - ├── dnst-cross_aarch64-unknown-linux-musl
.rwxr-xr-x  15M │   └── dnst
drwxr-xr-x    - ├── dnst-cross_arm-unknown-linux-musleabihf
.rwxr-xr-x  14M │   └── dnst
drwxr-xr-x    - ├── dnst-cross_armv7-unknown-linux-musleabihf
.rwxr-xr-x  14M │   └── dnst
.rw-r--r-- 6.5k ├── dnst-ldnsutils-0.2.0alpha2-1-any.pkg.tar.zst
.rw-r--r-- 7.9k ├── dnst-ldnsutils-0.2.0~alpha2-1.noarch.rpm
.rw-r--r-- 6.3k ├── dnst-ldnsutils_0.2.0_alpha2_noarch.apk
.rw-r--r-- 5.9k ├── dnst-ldnsutils_0.2.0~alpha2_all.deb
.rw-r--r-- 2.3k ├── dnst_0.2.0-alpha2_checksums.txt
.rw-r--r--  119 ├── dnst_0.2.0-alpha2_checksums.txt.sig
.rw-r--r-- 5.0M ├── dnst_0.2.0-alpha2_linux_amd64.tar.gz
.rw-r--r-- 5.9M ├── dnst_0.2.0-alpha2_linux_arm.tar.gz
.rw-r--r-- 6.5M ├── dnst_0.2.0-alpha2_linux_arm64.tar.gz
.rw-r--r-- 5.8M ├── dnst_0.2.0-alpha2_linux_armv7.tar.gz
.rw-r--r-- 6.6M ├── dnst_0.2.0_alpha2_aarch64.apk
.rw-r--r-- 6.0M ├── dnst_0.2.0_alpha2_armhf.apk
.rw-r--r-- 5.9M ├── dnst_0.2.0_alpha2_armv7.apk
.rw-r--r-- 5.2M ├── dnst_0.2.0_alpha2_x86_64.apk
.rw-r--r-- 5.0M ├── dnst_0.2.0~alpha2_amd64.deb
.rw-r--r-- 6.4M ├── dnst_0.2.0~alpha2_arm64.deb
.rw-r--r-- 5.8M ├── dnst_0.2.0~alpha2_armhf.deb
.rw-r--r-- 5.9M ├── dnst_0.2.0~alpha2_armhf6.deb
drwxr-xr-x    - ├── dnst_x86_64-unknown-linux-gnu.2.38
.rwxr-xr-x  14M │   └── dnst
.rw-r--r--  242 └── metadata.json

Docker images would be automatically published, but as I'm only testing, they
get added to my docker image store:

nlnetlabs/dnst:latest-amd64                           2161542f64d1        175MB         51.7MB
nlnetlabs/dnst:latest-arm64                           b8ff209cb0f7       53.3MB         53.3MB
nlnetlabs/dnst:latest-armv7                           1b02ed8b7baa       48.7MB         48.7MB
nlnetlabs/dnst:v0.2.0-alpha2-SNAPSHOT-cef303a-amd64   2161542f64d1        175MB         51.7MB
nlnetlabs/dnst:v0.2.0-alpha2-SNAPSHOT-cef303a-arm64   b8ff209cb0f7       53.3MB         53.3MB
nlnetlabs/dnst:v0.2.0-alpha2-SNAPSHOT-cef303a-armv7   1b02ed8b7baa       48.7MB         48.7MB

Notable differences:

Dependencies:

With Goreleaser we have to specify the dependencies manually.

cargo-generate-rpm generates them automatically using /usr/lib/rpm/find-requires, which uses rpmdeps and its internal dependency generator.

cargo-deb generates them using dpkg-shlibdeps.

Dependencies generated vs manual

Generated for RPM:

ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.15)(64bit)
libc.so.6(GLIBC_2.16)(64bit)
libc.so.6(GLIBC_2.17)(64bit)
libc.so.6(GLIBC_2.18)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.25)(64bit)
libc.so.6(GLIBC_2.28)(64bit)
libc.so.6(GLIBC_2.29)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.2)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.30)(64bit)
libc.so.6(GLIBC_2.32)(64bit)
libc.so.6(GLIBC_2.33)(64bit)
libc.so.6(GLIBC_2.34)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
libc.so.6(GLIBC_2.9)(64bit)
libcrypto.so.3()(64bit)
libcrypto.so.3(OPENSSL_3.0.0)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.29)(64bit)
libssl.so.3()(64bit)
libssl.so.3(OPENSSL_3.0.0)(64bit)

Manual:

glibc >= 2.38
openssl-libs >= 3.0.0

Generated for DEB:

root@cadb55f113ee:/# dpkg-shlibdeps -O -l/usr/lib/x86_64-linux-gnu/ dnst
dpkg-shlibdeps: warning: diversions involved - output may be incorrect
 diversion by libc6 from: /lib64/ld-linux-x86-64.so.2
dpkg-shlibdeps: warning: diversions involved - output may be incorrect
 diversion by libc6 to: /lib64/ld-linux-x86-64.so.2.usr-is-merged
dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
shlibs:Depends=libc6 (>= 2.34), libssl3t64 (>= 3.0.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant